package no.uio.ifi.cop.util;

/**
 * Stoppable is a Runnable with a stop function.
 *
 * The way Java has organized its multi-thread execution
 * with the removal of its destroy function, or it has
 * been depricated because of safety. We need another way
 * to end threads that are on the loose beyond their limited
 * time, so we can implement a Stoppable Runnable, which is
 * what this is. Example
 *
 * <pre>
 *
 * Stoppable s = new SomeImplementer();
 * Thread t = new Thread( s );
 *
 * t.start();
 *
 * try{
 *    Thread.sleep( someDelay );
 * }catch(Exception e){}
 *
 * if( s.isRunning() ){
 *    s.stop();
 * }
 * </pre>
 *
 * @version 1.0
 * @author  bjarneh@ifi.uio.no
 */

public interface Stoppable extends Runnable{
    public boolean isRunning();
    public void stop();
}
